/*
 * Copyright 2007 Matt Jensen
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 */
package org.jtell;

import org.jtell.config.ConfigurationSource;

/**
 * <p>
 * <code>JTellContextBuilder</code> defines the public interface to a JTell context builder. Instances are used to
 * create and configure {@link JTellContext} instances for use by the application.
 * </p>
 */
public interface JTellContextBuilder
{
    /**
     * <p>
     * Add an event metadata source.
     * </p>
     *
     * @param eventMetadataSource the event metadata source to add.
     * @return {@link JTellContextBuilder} this builder instance.
     */
    JTellContextBuilder addEventMetadataSource(EventMetadataSource eventMetadataSource);

    /**
     * <p>
     * Add an event sink source to the context.
     * </p>
     *
     * @param eventSinkSource the event sink source to add.
     * @return {@link JTellContextBuilder} this builder instance.
     */
    JTellContextBuilder addEventSinkSource(EventSinkSource eventSinkSource);

    /**
     * <p>
     * Create a {@link JTellContext} instance from the current internal state of this builder.
     * </p>
     *
     * @return {@link JTellContext} instance.
     */
    JTellContext createContext();

    /**
     * <p>
     * Set the configuration source.
     * </p>
     *
     * @param configurationSource the configuration source.
     * @return {@link JTellContextBuilder} this builder instance.
     */
    JTellContextBuilder setConfigurationSource(ConfigurationSource configurationSource);

    /**
     * <p>
     * Set the event sink registry.
     * </p>
     *
     * @param eventSinkRegistry the event sink registry.
     * @return {@link JTellContextBuilder} this builder instance.
     */
    JTellContextBuilder setEventSinkRegistry(EventSinkRegistry eventSinkRegistry);
}
